package com.tianyi.sfzy1.service;


import com.tianyi.sfzy1.domain.Coursereview;
import com.tianyi.sfzy1.mapper.CoursereviewMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class CoursereviewService {

    @Autowired
    private CoursereviewMapper coursereviewMapper;

//    由课程id查询所有的评价
    public List<Coursereview> findAll(int courseId){

        return coursereviewMapper.findAll(courseId);
    }

//    添加新评价
    public int insert(String content,int stars,int memberId,int courseId){
        return coursereviewMapper.insert(content,stars,memberId,courseId);
    }

}
